function AlertBox(type,text,color,func){
	//type = 1 弹出 2询问 3渐隐;
	//text = 显示的字符串; 
	//color = 'rgb(0,0,0)' or '#fff'; 
	//func = 点确定执行的函数 可为空;
	var thisType = type;
	var thisText = text || "";
	var thisColor = color || "rgb(255,95,51)";
	var thisFunc = func || null;
		if(typeof thisColor == "function"){
		    thisColor = "rgb(255,95,51)";
		    thisFunc = color;
		}
	var thisHtml;
	var thisErrImg = "";

	switch(thisType){
		case 1:
		    thisHtml = '<div id="alert_x_DIV" style="margin-top: -.2rem;font-size:0.26rem;background-color:rgba(0,0,0,0.5);position: fixed;width: 100%;height: 100%;z-index: 999;">'
			+ '<div style="background-color: #fff;top:10%;width: 80%;position: fixed;left: 10%;z-index: 1000;border-radius: 10px;">'
			+ '<div style="width:100%;height:80px;background-position:center center;background-repeat:no-repeat;background-size:12px 34px;text-align:center;">'
			+ '<div style="width:40px;height:40px;background-color:'+thisColor+';background-image:url('+thisErrImg+');background-position:center center;background-repeat:no-repeat;border-radius: 100%;display: inline-block;margin-top: 20px;"></div>'
			+ '</div>'
			+ '<div style="width:90%;margin-left:5%;line-height:30px;text-align:center;word-wrap:break-word;">'+thisText+'</div>'
			+ '<div style="width:90%;margin-left:5%;height:40px;margin-bottom:20px;margin-top:20px;">'
			+ '<div style="float:right;height:40px;line-height:40px;width:100%;background-color:'+thisColor+';border-radius:5px;color:#fff;text-align:center;" onclick="alert_x_ok();">确认</div>'
			+ '<div style="clear:both;"></div></div></div></div>';
			$("body").prepend(thisHtml);
			break;
		case 2:
		thisHtml = '<div id="alert_x_DIV" style="font-size:0.26rem;background-color:rgba(0,0,0,0.5);position: fixed;width: 100%;height: 100%;z-index: 999;">'
			+ '<div style="background-color: #fff;top:10%;width: 80%;position: fixed;left: 10%;z-index: 1000;border-radius: 10px;">'
			+ '<div style="width:100%;height:80px;background-position:center center;background-repeat:no-repeat;background-size:12px 34px;text-align:center;">'
			+ '<div style="width:40px;height:40px;background-color:'+thisColor+';background-image:url('+thisErrImg+');background-position:center center;background-repeat:no-repeat;border-radius: 100%;display: inline-block;margin-top: 20px;"></div>'
			+ '</div>'
			+ '<div style="width:90%;margin-left:5%;line-height:30px;text-align:center;word-wrap:break-word;">'+thisText+'</div>'
			+ '<div style="width:90%;margin-left:5%;height:40px;margin-bottom:20px;margin-top:20px;">'
			+ '<div style="float:left;height:40px;line-height:40px;width:40%;background-color:#c2c2c2;border-radius:5px;color:#fff;text-align:center;" onclick="alert_x_cancel();">取消</div>'
			+ '<div style="float:right;height:40px;line-height:40px;width:40%;background-color:'+thisColor+';border-radius:5px;color:#fff;text-align:center;" onclick="alert_x_ok();">确认</div>'
			+ '<div style="clear:both;"></div></div></div></div>';
			$("body").prepend(thisHtml);
			break;
		case 3:
		thisHtml = '<div id="alert_x_TDIV" style="font-size:0.26rem;box-shadow:0 0 10px #000;background-color:#fff;bottom:5%;width: 70%;position:fixed;left:15%;z-index:1000;border-radius: 10px;">'
			+ '<div style="width:100%;height:50px;background-position:center center;background-repeat:no-repeat;background-size:12px 34px;text-align:center;">'
			+ '<div style="width:40px;height:40px;background-color:'+thisColor+';background-image:url('+thisErrImg+');background-position:center center;background-repeat:no-repeat;border-radius: 100%;display: inline-block;margin-top:5px;"></div>'
			+ '</div>'
			+ '<div style="width:90%;margin-left:5%;line-height:30px;text-align:center;word-wrap:break-word;">'+thisText+'</div>'
			+ '<div style="clear:both;"></div></div>';
			$("body").prepend(thisHtml);
		    $("#alert_x_TDIV").fadeOut(3000, function () {
		        alert_x_ok();
		    });
			break;
		default :
			break;
	}

	alert_x_cancel = function(){
		$("#alert_x_DIV").remove();
	}

	alert_x_ok = function(){
		if(thisFunc != null) thisFunc();
		$("#alert_x_DIV").remove();
	}
}